import http from './http'
import { getUser } from '../auth'

export const save = async(item) =>{
    return await http.fetchPost(`/api/company/register`, item);
}

export const getPage = async(index, pageSize) =>{
    return await http.fetchGet(`/api/company/page?pageIndex=${index}&pageSize=${pageSize}`);
}

export const verify = async(item) => {
    let user = getUser()
    return await http.fetchPost(`/api/company/verify`, {id : item.id, user : user.user});
}

export const update = async(item) =>{
    return await http.fetchPost(`/api/company/update`, item);
}

export const exist = async (value) =>{
    return http.fetchPost(`/api/company/exist?user=${value}`, {})
}

export const del = async(item) =>{
    return http.fetchPost(`/api/company/delete?id=${item.id}`, {})
}